import 'package:flutter/material.dart';
import 'package:pplive/routes/AppRoute.dart';

import '../models/hot_model.dart';

abstract class RoomBaseCell extends StatelessWidget {
  const RoomBaseCell({super.key, this.index, required this.live});

  final int? index;
  final LiveModel live;

  Widget buildChild(BuildContext context);

  @override
  Widget build(BuildContext context) {
    // ThemeData theme = Theme.of(context);
    return InkWell(
        onTap: () {
          AppPage.squareSub.go();
        },
        child: Container(
          decoration: BoxDecoration(
            color: Colors.grey,
            borderRadius: BorderRadius.circular(8.0),
            image: DecorationImage(
              image: NetworkImage(live.live?.coverUrl ?? ""),
              fit: BoxFit.cover,
            ),
          ),
          child: buildChild(context),
        )
    );
  }
}